<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateProjectsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('projects', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name', 100)->default('')->nullable(false)->comment('项目名称');
            $table->string('reason', 255)->default('')->comment('项目申请理由');
            $table->string('first_party', 255)->default('')->comment('项目甲方');
            $table->decimal('money', 10, 2)->default(0.00)->comment('项目金额');
            $table->integer('uid')->default(0)->comment('申请人id');
            $table->tinyInteger('status')->default(0)->comment('审核状态 0待审核，1审核通过，2审核未通过');
            $table->tinyInteger('execute_status')->default(0)->comment('执行状态 0待开工，1正在执行，2已完成');
            $table->tinyInteger('accept_status')->default(0)->comment('验收状态 0待验收，1验收通过，2未通过');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('projects');
    }
}
